home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / tools / czesc_1 / change / change.doc < prev    next >
Text File  |  1984-07-17  |  7KB  |  186 lines

  1.                     Change Version 2.19 (02.08.96)
  2.  
  3. This program gives you the ability to search for different strings in files
  4. and to replace them with other string. The file could be binary or ascii.
  5. An example is if you change your harddisk and then most of the old path
  6. names also change. Normally you have to do this file for file by hand. With
  7. change it's much more easier! Only use change in a script with all (or all
  8. needed) files and the replacement is done.
  9.  
  10. Change is programmed with MaxonC++ V3.00 (but mostly in C and not C++) and
  11. it's Public Domain. I give all rights of the program to the user, but the
  12. same way I give no guarantee that the program works well. Use it of your
  13. own risk!
  14.  
  15. Since version 2.0 Change has a graphical GUI. The elements of the GUI are
  16. the same like the Shell arguments! You can start Change with GUI from WB
  17. or from Shell without arguments. If you give arguments in the shell, Change
  18. will work with this arguments without openening a window!
  19.  
  20. Since version 2.3 the Shell arguments are read with ReadArgs. This means,
  21. that there are some changes to earlier versions.
  22.  
  23. The program requires OS2.0 (V37) or any later version.
  24.  
  25. The history of the program is in the source code -> source/Change/Change.c
  26.  
  27. If you call Change with ?(»Change ?«) you get the following argument list:
  28.  
  29. FROM/A,SSTRING/A,TO,RSTRING,FOUND/S,HEX/S,LENGTH/S,NOCHANGE/S,NOSIZE/S,
  30. OVERWRITE/S,PATH/S,POS=POSITION/K:
  31.  
  32. Enter again a ? and you will get a better explanation.
  33.  
  34. With »Version Change FULL« you get the actual version of this program.
  35. Thats usefull for updating.
  36.  
  37. Explanation of arguments:
  38. FROM        the already existing file Change should work with
  39.         > needed every time !
  40. SSTRING        is the string Change should search for
  41.                 > needed every time !
  42. TO        the file Change should write to
  43.         if it's the same like FROM (or their is no TO) it will be
  44.         overwritten! (only if there is enough memory to load it,
  45.         else the name will get _ at the end)
  46.                 > needed every time (not with option NOCHANGE)
  47. RSTRING        is the replacement for SSTRING
  48.                 > not needed, if not given an empty string is used
  49. FOUND           gives you  every tim SSTRING is found or changed a output
  50.         (for example: String found at 32C). The number is the hexa-
  51.         decimal code of the position.
  52.                 > not needed, of no use with NOCHANGE
  53. HEX             gives you the posibility to enter the strings as hex
  54.         numbers. (Some chars can't be entered with the keyboard -
  55.         RETURN - 0A for example)
  56.                 > not needed
  57. LENGTH          changes the length information of a BCPL string (first
  58.         character contains length of string)
  59.                 > not needed, of no use with NOCHANGE and same length of
  60.                 of the strings, idiotic with a normal C-string (with 0 at
  61.                 end)
  62. NOCHANGE        turn of the replacement, only search SSTRING like Search
  63.         command in C:, Option FOUND automatical turned on
  64.         > not needed, Options TO, LENGTH, OVERWRITE, PATH, RSTRING
  65.         not useable
  66. NOSIZE          scan case insensitiv
  67.                 > not needed
  68. OVERWRITE       If RSTRING is longer than SSTRING the chars after RSSTRING
  69.         will be replaced, if RSTRING is shorter, the rest will be
  70.         filled with 0. This option is useful if you change strings
  71.         in executable filles, because the length can't be changed
  72.                 > not needed, of no use with same length of the strings
  73. PATH            Option to replace path names. It's like overwrite, but the
  74.         filling or overwriting starts first, when a 0 is found after
  75.         the replacement!
  76.                 > turned of with OVERWRITE or same length of strings
  77. POS             see POSITION
  78. POSITION        After POSITION you have to give a hex number of the position
  79.         you want to change sstring. If there is no sstring at this
  80.         position no replacement would be done. A position you can
  81.         get before that with the option NOCHANGE
  82.                 > not needed, of no use with NOCHANGE
  83.  
  84.  
  85. If you give no keywords, the first string is FROM, the second SSTRING, the
  86. third TO and the fourth RSTRING.
  87.  
  88. Change also works with a pattern. If there is a \? in the text (or a ? in
  89. HEX mode) at this position every char will be accepted!
  90. Important:
  91.     \? is the pattern
  92.     \\ means one \
  93.     \  and after this a hex number with 2 digits means the char given
  94.     through the ascii-code(f.i. \57 is a W)
  95.         
  96. (see the examples)
  97. If you enter strings with HEX option all chars of no use are ignored. Only
  98. (0..9 a..f A..F ?) will be recognized. This means you can enter slashes
  99. between the chars to make it better visible.
  100. 123a4b52349f009a is the same as 123a_4b52_349f_009a or 123a.4b52.349f.009a
  101. or 1-2-3-a-4-b-5-2-3-4-9-f-0-0-9-a.
  102.  
  103. At the program start Change tells you the two strings it works with.
  104. Chars from 20 to 7E and from A1 to FF will be shown like given. 
  105. . means a non printable char and
  106. _ means a pattern.
  107.  
  108. At the end the program gives you a status report of the done work:
  109. String ... times found and ... times changed
  110.  
  111. Examples:
  112. You want to search in the file SYS:Texts/S the name Intel:
  113. --> Change SYS:Texts/S Intel NOCHANGE
  114.  
  115. With hex option it looks like this:
  116. --> Change SYS:Texts/S 496E74_656C NOCHANGE HEX
  117.  
  118. If you want to change Intel to Motorola you must give me a destination
  119. (SYS:Texts/S2) and remove NOCHANGE:
  120. --> Change SYS:Texts/S Intel SYS:Texts/S2 Motorola
  121.  
  122. With NOSIZE  you can also scan for intel, InTeL, INTEL and other forms,
  123. FOUND shows you the position of the string:
  124. --> Change SYS:Texts/S Intel SYS:Texts/S2 Motorola NOSIZE FOUND
  125.  
  126. Use the CD command before that, so the arguments will be shorter
  127. Befehl:
  128. --> CD SYS:Texts
  129.     Change S Intel S2 Motorola NOSIZE FOUND
  130.  
  131. If you want to replace wrong written word MoToRoLa or motorola with the 
  132. capitalized version Motorola, use this (remember NOSIZE doesn't change the
  133. destination string):
  134. --> Change S motorola S2 Motorola NOSIZE
  135.  
  136. If Intel should be replaced only at one position so use POSITION:
  137. --> Change S Intel S2 Motorola POSITION D3 NOSIZE
  138.  
  139. Alternativly use POS:
  140. --> Change S Intel S2 Motorola POS D3 NOSIZE
  141.  
  142. If the strings contain spaces use "":
  143. --> Change S "Intel is good" S2 "Motorola is better"
  144.  
  145. You can also delete the SSTRING in the file:
  146. --> Change S Intel S2 ""            or
  147. --> Change S Intel S2
  148.  
  149. If you want to replace words, which don't differ very much (Disk and Disc
  150. with discette) so use a Pattern:
  151. --> Change S Dis\? S2 discette
  152.  
  153. or
  154.  
  155. --> Change S 446973? S2 64697363_65747465
  156.  
  157. If you want to search for a \ so enter they every time twice. (6 instead
  158. of 3 ...)
  159. --> Change S \\ S2 /            --> changes \ to /
  160.  
  161. --> Change S \\\\ S2 //         --> changes \\ to //
  162.  
  163. --> Change S \\? S2 /?          --> changes \? to /? (no pattern !)
  164.  
  165. but rememeber:
  166.  
  167. --> Change S \? S2 /?           --> changes every char to /?
  168.  
  169. If SSTRING is "" an error appears.
  170.  
  171. Plans for the future:
  172.  
  173. The pattern * for a variable number of chars or the standard Amiga patterns,
  174. like #, ~, ().
  175. Localisation and together with this german texts (The OS errors are already
  176. localized by the OS!).
  177.  
  178. Comments, wishes, money (its Public Domain, but why not), greetings and
  179. bug reports to
  180.  
  181. snail-mail:    Dirk Stöcker
  182.         Geschwister-Scholl-Straße 10
  183.         01877 Bischofswerda
  184.         GERMANY
  185. e-mail:        stoecker@rcs.urz.tu-dresden.de
  186.